<%-- 
    Document   : master
    Created on : Aug 27, 2013, 11:38:17 AM
    Author     : C@T
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!--JSTL-->
        <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
        <c:set var="selectLang" value="${pageContext.request.locale}"/>
        <c:if test="${!empty param.lang}">
            <c:set var="selectLang" value="${param.lang}"/>
        </c:if>
        <fmt:setLocale value="${param.lang}" scope="session"/>
        <fmt:setBundle basename="input" scope="session"/>
        <!--CSS-->
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <!--jQuery-->
        <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
        <script type="text/javascript">
            $(function() {
                //Co dinh menu khi truot
                var hide = true;
                var lastScroll = 30;
                $("#show-hide-banner").hide();
                $(window).scroll(function(event) {
                    var st = $(this).scrollTop();
                    if (st > lastScroll) {
                        $("#panel").slideUp("fast");

                        $("#show-hide-banner").show();
                        $("#show-hide-banner").removeClass("show");
                        $("#show-hide-banner").addClass("hide");
                        hide = true;
                    } else {
                        $("#panel").slideDown("slow");
                        $("#show-hide-banner").hide();
                    }
                });
                //Show or Hide banner
                $("#show-hide-banner").click(function() {
                    //window.scrollTo(0, 0);
                    //$("html").animate({scrollTop: 0}, "slow");//IE, FF
                    //$("body").animate({scrollTop: 0}, "slow");//chrome, don't know if Safari works
                    $("#panel").slideToggle("slow");
                    //$("#panelFixed").fadeToggle("slow");
                    if (hide == true) {
                        $("#show-hide-banner").removeClass("hide");
                        $("#show-hide-banner").addClass("show");
                        hide = false;
                    } else {
                        $("#show-hide-banner").removeClass("show");
                        $("#show-hide-banner").addClass("hide");
                        hide = true;
                    }
                });
                //Thay doi ngon ngu
                var namePop = null;
                $("#popBox").hide();
                $("#wrapper").click(function() {
                    if (namePop != 'popBox') {
                        $("#" + namePop).hide();
                    }
                    $("#popBox").animate({
                        height: 'toggle'
                    });
                    namePop = 'popBox';
                });
                //User
                $("#popBoxUser").hide();
                $("#wrapperUser").click(function() {
                    if (namePop != 'popBoxUser') {
                        $("#" + namePop).hide();
                    }
                    $("#popBoxUser").animate({
                        height: 'toggle'
                    });
                    namePop = 'popBoxUser';
                });
                //Request
                $("#popBoxRequest").hide();
                $("#wrapperRequest").click(function() {
                    if (namePop != 'popBoxRequest') {
                        $("#" + namePop).hide();
                    }
                    $("#popBoxRequest").animate({
                        height: 'toggle'
                    });
                    namePop = 'popBoxRequest';
                });
            });
        </script>
        <title>JSP Page</title>
    </head>
    <body>
        <div style=" position: fixed;">
            <div id="panel" style="background: #A80037; width: 800px">
                <table border="0" width="800px">
                    <tr>
                        <td rowspan="5" width="420px" align="left">
                            <img src="images/logo.png" height="100px" width="180px" alt="Logo"/>
                        </td>
                    </tr>
                    <!--Row chua code thay doi ngon ngu--->
                    <tr style="height: 25px">
                        <td colspan="3" align="right" >
                            <table>
                                <tr>
                                    <td class="text-nomarl-while">
                                        <fmt:message key="language.title"/>:
                                    </td>
                                    <td class="text-nomarl-reb">
                                        <div id="wrapper" class="text-nomarl-while">
                                            <a href="#">
                                                <c:if test="${selectLang=='en_US'}">
                                                    <img src='images/england.png' title="English" border="0" alt="England">
                                                </c:if>
                                                <c:if test="${selectLang=='vi_VN'}">
                                                    <img src='images/vietnam.png' title="Viet Nam" border="0" alt="Vietnamese">
                                                </c:if>
                                            </a>
                                        </div>
                                        <div id="popBox">
                                            <div id="popBoxArrow" >
                                            </div>
                                            <table>
                                                <tr>
                                                    <td align="left">
                                                        <a href="index.jsp?lang=en_US" class="text-nomarl-reb" style="text-decoration: none;">
                                                            <img src='images/england.png' title="English" border="0" alt="England" > 
                                                        </a>
                                                    </td>
                                                    <td style="padding-bottom: 2px" align="left">
                                                        <a href="index.jsp?lang=en_US" class="text-nomarl-reb" style="text-decoration: none;">
                                                            <fmt:message key="language.english"/>
                                                        </a>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td colspan="2" style="height: 10px">
                                                        
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="left">
                                                        <a href="index.jsp?lang=vi_VN" class="text-nomarl-reb" style="text-decoration: none">
                                                            <img src='images/vietnam.png' title="Vietnamese" border="0" alt="Vietnamese">
                                                        </a>
                                                    </td>
                                                    <td style="padding-bottom: 2px" align="left">
                                                        <a href="index.jsp?lang=vi_VN" class="text-nomarl-reb" style="text-decoration: none">
                                                            <fmt:message key="language.vietnamese"/>
                                                        </a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <!--Cot chua code login--->
                    <!--Náº¿u Ä‘Ã£ login thÃ¬ hiá»‡n pháº§n nÃ y-->

                    <%
                        if (request.getSession().getAttribute("login") != null) {
                    %>
                    <tr>
                        <td colspan="3" style="width: 100px"></td>
                    </tr>
                    <tr>
                        <td align="right" colspan="3">
                            <table style="width: 100%">
                                <tr>
                                    <td class="text-nomarl-while" align="right">
                                        <%
                                            out.println(request.getSession().getAttribute("fullName").toString());
                                        %>
                                    </td>
                                    <td style="width: 60px" align="center">
                                        <div id="wrapperRequest" class="heart">
                                            <a href="#" class="text-heart">
                                                <div>
                                                    <%
                                                        out.println(request.getSession().getAttribute("totalRequest").toString());
                                                    %>
                                                </div>
                                            </a>
                                        </div>
                                        <div id="popBoxRequest">
                                            <div id="popBoxArrowRequest" >
                                            </div>
                                            <jsp:include page="RequestPopup.jsp"/>
                                        </div>
                                    </td>
                                    <td style="width: 100px" align="left">
                                        <div class="avatar" id="wrapperUser">
                                            <%
                                                String avatar = "avatar/" + request.getSession().getAttribute("avatar").toString();
                                                out.println("<a href='#'><img src=" + avatar + " width='40' height='40' border='0' alt='User'/></a>");
                                            %>
                                        </div>
                                        <div id="popBoxUser">
                                            <div id="popBoxArrowUser" >
                                            </div>
                                            <jsp:include page="UserPopup.jsp"/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                    <%                            } else {
                    %>
                    <form action="Login" method="POST">
                        <tr>
                            <td>
                                <div align="left" class="text-nomarl-while"><fmt:message key="login.user"/></div>
                            </td>
                            <td>
                                <div align="left" class="text-nomarl-while"><fmt:message key="login.pass"/></div>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td align="left">
                                <input type="text" name="txtUsername" value="" class="gwt-TextBox-master"/>
                            </td>
                            <td  align="left">
                                <input type="password" name="txtPassword" value="" class="gwt-TextBox-master"/>
                            </td>
                            <td  align="left" style="width: 85px">
                                <input type="submit" value="<fmt:message key='login.button-login'/>" class="gwt-Button-small" />
                            </td>
                        </tr>
                        <tr>
                            <td  align="left">
                                <div class="text-nomarl-while"><input type="checkbox" name="cbKeep" value="" checked class="gwt-Combobox-master"/><fmt:message key="login.keepme"/></div>
                            </td>
                            <td  align="left">
                                <a href="" class="text-nomarl-while" style="text-decoration: none"><fmt:message key="login.forgot"/></a>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </form>
                    <%                                }
                    %>
                </table>
            </div>        
            <div>
                <ul class="MenuBarHorizontal">
                    <li>
                        <h1>
                            <div id="show-hide-banner">

                            </div>
                        </h1>
                    </li>
                    <li>                        
                        <p id="title">
                            MATRIMONY.COM
                        </p>
                    </li>
                    <li><a class="home" href="index.jsp"><fmt:message key="menu.homepage"/></a></li>
                    <li><a class="search" href="Search.jsp"><fmt:message key="menu.search"/></a></li>
                    <li><a class="services" href="Services.jsp"><fmt:message key="menu.services"/></a></li>
                    <li><a class="contact" href="contact.jsp"><fmt:message key="menu.contact"/></a></li>
                </ul>
            </div>
        </div>
        <div style="padding-top: 160px">
        </div>

    </body>
</html>
